/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package business;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 *
 * @author Alberto
 */
@Entity
@Table(name = "rol")
@NamedQueries({
   })
public class Rol implements Serializable {
    private static final long serialVersionUID = 1L;
 
    private Integer idrol;
    private String caracteristicas;

    public Rol() {
    }

    public Rol(String caracteristicas) {
        this.caracteristicas = caracteristicas;
    }

  

    @TableGenerator(
        name="rolGen",
        table="JPA_GENERATOR",
        pkColumnName="GEN_KEY",
        valueColumnName="GEN_VALUE",
        pkColumnValue="ROL_ID",
        allocationSize=1,
        initialValue=0)
        @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.TABLE,generator="rolGen")
    @Column(name = "idrol", nullable = false)
    public Integer getIdrol() {
        return idrol;
    }

    public void setIdrol(Integer idrol) {
        this.idrol = idrol;
    }

    @Column(name = "caracteristicas",unique=true)
    public String getCaracteristicas() {
        return caracteristicas;
    }

    public void setCaracteristicas(String caracteristicas) {
        this.caracteristicas = caracteristicas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idrol != null ? idrol.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Rol)) {
            return false;
        }
        Rol other = (Rol) object;
        if ((this.idrol == null && other.idrol != null) || (this.idrol != null && !this.idrol.equals(other.idrol))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "business.Rol[idrol=" + idrol + "]";
    }

}
